package com.czkt.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.czkt.entity.CstCustomer;
import com.czkt.entity.vo.CstCustomerBasDict;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2024-06-18
 */
@Mapper
public interface CstCustomerMapper extends BaseMapper<CstCustomer> {
    @Select("select * from bas_dict b,cst_customer c where b.dict_value = c.cust_region and c.cust_name like concat('%',#{custName},'%')  and c.cust_region like concat('%',#{custRegion},'%')")
    IPage<CstCustomerBasDict> cusTomerBas(IPage<CstCustomerBasDict> cstCustomerBasDictIPage,@Param("custName")String custName, @Param("custRegion")String custRegion);

    @Delete("delete from cst_customer where cust_no = #{custNo};")
    int deleteByCustAddr(@Param("custNo") String custNo);
}
